package by.airlanterns.dao;

import by.airlanterns.dto.Category;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Sergey
 * Date: 27.01.13
 * Time: 17:18
 * To change this template use File | Settings | File Templates.
 */
@Controller
public class CategoryDaoImpl extends GenericDaoImpl<Category, Integer> {

    @Override
    protected Class<Category> getEntityClass() {
        return Category.class;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<Category> findCategoryByTitle(String title) {
        return getHibernateTemplate().find("from " + Category.class.getName() + " where category_title = " + title);
    }
}
